package com.asiainfo.crm.core.web;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.BodyTagSupport;

import com.asiainfo.crm.core.common.CommFunc;

public class RightTag extends BodyTagSupport {
	private String url;

	public int doStartTag() throws JspException {
		if (!CommFunc.hasRight((HttpServletRequest) pageContext.getRequest(),
				url)) {
			return SKIP_BODY;

		} else {
			return EVAL_BODY_INCLUDE;
		}
	}

	public int doAfterBody() throws JspException {

		return EVAL_PAGE;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

}
